<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template histogram</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../histogram/reference.html#header.boost.histogram.histogram_hpp" title="Header &lt;boost/histogram/histogram.hpp&gt;">
<link rel="prev" href="axis/null_type.html" title="Struct null_type">
<link rel="next" href="operator_idm11825.html" title="Function template operator*">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="axis/null_type.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../histogram/reference.html#header.boost.histogram.histogram_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="operator_idm11825.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.histogram"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template histogram</span></h2>
<p>boost::histogram::histogram — Central class of the histogram library. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../histogram/reference.html#header.boost.histogram.histogram_hpp" title="Header &lt;boost/histogram/histogram.hpp&gt;">boost/histogram/histogram.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Axes<span class="special">,</span> <span class="keyword">typename</span> Storage<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="histogram.html" title="Class template histogram">histogram</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="identifier">Axes</span>                                  <a name="boost.histogram.histogram.axes_type"></a><span class="identifier">axes_type</span><span class="special">;</span>       
  <span class="keyword">typedef</span> <span class="identifier">Storage</span>                               <a name="boost.histogram.histogram.storage_type"></a><span class="identifier">storage_type</span><span class="special">;</span>    
  <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">storage_type</span><span class="special">::</span><span class="identifier">value_type</span>     <a name="boost.histogram.histogram.value_type"></a><span class="identifier">value_type</span><span class="special">;</span>      
  <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">storage_type</span><span class="special">::</span><span class="identifier">iterator</span>       <a name="boost.histogram.histogram.iterator"></a><span class="identifier">iterator</span><span class="special">;</span>        
  <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">storage_type</span><span class="special">::</span><span class="identifier">const_iterator</span> <a name="boost.histogram.histogram.const_iterator"></a><span class="identifier">const_iterator</span><span class="special">;</span>  
  <span class="keyword">typedef</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span>                           <a name="boost.histogram.histogram.multi_index_type"></a><span class="identifier">multi_index_type</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="histogram.html#boost.histogram.histogramconstruct-copy-destruct">construct/copy/destruct</a></span>
  <a class="link" href="histogram.html#idm11776-bb"><span class="identifier">histogram</span></a><span class="special">(</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> A<span class="special">,</span> <span class="keyword">typename</span> S<span class="special">&gt;</span> <span class="keyword">explicit</span> <a class="link" href="histogram.html#idm11777-bb"><span class="identifier">histogram</span></a><span class="special">(</span><a class="link" href="histogram.html" title="Class template histogram">histogram</a><span class="special">&lt;</span> <span class="identifier">A</span><span class="special">,</span> <span class="identifier">S</span> <span class="special">&gt;</span> <span class="special">&amp;&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> A<span class="special">,</span> <span class="keyword">typename</span> S<span class="special">&gt;</span> 
    <span class="keyword">explicit</span> <a class="link" href="histogram.html#idm11784-bb"><span class="identifier">histogram</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="histogram.html" title="Class template histogram">histogram</a><span class="special">&lt;</span> <span class="identifier">A</span><span class="special">,</span> <span class="identifier">S</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> A<span class="special">&gt;</span> <a class="link" href="histogram.html#idm11809-bb"><span class="identifier">histogram</span></a><span class="special">(</span><span class="identifier">A</span> <span class="special">&amp;&amp;</span><span class="special">,</span> <span class="identifier">Storage</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">explicit</span> <a class="link" href="histogram.html#idm11816-bb"><span class="identifier">histogram</span></a><span class="special">(</span><span class="identifier">Axes</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...</span> As<span class="special">&gt;</span> <span class="keyword">explicit</span> <a class="link" href="histogram.html#idm11819-bb"><span class="identifier">histogram</span></a><span class="special">(</span><span class="identifier">As</span> <span class="special">&amp;&amp;</span><span class="special">...</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> A<span class="special">,</span> <span class="keyword">typename</span> S<span class="special">&gt;</span> <a class="link" href="histogram.html" title="Class template histogram">histogram</a> <span class="special">&amp;</span> <a class="link" href="histogram.html#idm11791-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><a class="link" href="histogram.html" title="Class template histogram">histogram</a><span class="special">&lt;</span> <span class="identifier">A</span><span class="special">,</span> <span class="identifier">S</span> <span class="special">&gt;</span> <span class="special">&amp;&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> A<span class="special">,</span> <span class="keyword">typename</span> S<span class="special">&gt;</span> 
    <a class="link" href="histogram.html" title="Class template histogram">histogram</a> <span class="special">&amp;</span> <a class="link" href="histogram.html#idm11800-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="histogram.html" title="Class template histogram">histogram</a><span class="special">&lt;</span> <span class="identifier">A</span><span class="special">,</span> <span class="identifier">S</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="histogram.html#idm11382-bb">public member functions</a></span>
  <span class="keyword">constexpr</span> <span class="keyword">unsigned</span> <a class="link" href="histogram.html#idm11383-bb"><span class="identifier">rank</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="histogram.html#idm11386-bb"><span class="identifier">size</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="histogram.html#idm11389-bb"><span class="identifier">reset</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">unsigned</span> N <span class="special">=</span> <span class="number">0</span><span class="special">&gt;</span> 
    <span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a class="link" href="histogram.html#idm11392-bb"><span class="identifier">axis</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">integral_constant</span><span class="special">&lt;</span> <span class="keyword">unsigned</span><span class="special">,</span> <span class="identifier">N</span> <span class="special">&gt;</span> <span class="special">=</span> <span class="special">{</span><span class="special">}</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a class="link" href="histogram.html#idm11404-bb"><span class="identifier">axis</span></a><span class="special">(</span><span class="keyword">unsigned</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Unary<span class="special">&gt;</span> <span class="keyword">auto</span> <a class="link" href="histogram.html#idm11411-bb"><span class="identifier">for_each_axis</span></a><span class="special">(</span><span class="identifier">Unary</span> <span class="special">&amp;&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T0<span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> Ts<span class="special">&gt;</span> 
    <span class="identifier">iterator</span> <a class="link" href="histogram.html#idm11418-bb"><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T0</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Ts</span> <span class="special">&amp;</span><span class="special">...</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...</span> Ts<span class="special">&gt;</span> <span class="identifier">iterator</span> <a class="link" href="histogram.html#idm11447-bb"><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">tuple</span><span class="special">&lt;</span> <span class="identifier">Ts</span><span class="special">...</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Iterable<span class="special">&gt;</span> <span class="keyword">void</span> <a class="link" href="histogram.html#idm11456-bb"><span class="identifier">fill</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Iterable</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Iterable<span class="special">,</span> <span class="keyword">typename</span> T<span class="special">&gt;</span> 
    <span class="keyword">void</span> <a class="link" href="histogram.html#idm11470-bb"><span class="identifier">fill</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Iterable</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="weight_type.html" title="Struct template weight_type">weight_type</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Iterable<span class="special">,</span> <span class="keyword">typename</span> T<span class="special">&gt;</span> 
    <span class="keyword">void</span> <a class="link" href="histogram.html#idm11487-bb"><span class="identifier">fill</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="weight_type.html" title="Struct template weight_type">weight_type</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Iterable</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Iterable<span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> Ts<span class="special">&gt;</span> 
    <span class="keyword">void</span> <a class="link" href="histogram.html#idm11504-bb"><span class="identifier">fill</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Iterable</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="sample_type.html" title="Struct template sample_type">sample_type</a><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">tuple</span><span class="special">&lt;</span> <span class="identifier">Ts</span><span class="special">...</span> <span class="special">&gt;&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Iterable<span class="special">,</span> <span class="keyword">typename</span> T<span class="special">&gt;</span> 
    <span class="keyword">void</span> <a class="link" href="histogram.html#idm11522-bb"><span class="identifier">fill</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="sample_type.html" title="Struct template sample_type">sample_type</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Iterable</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Iterable<span class="special">,</span> <span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> Ts<span class="special">&gt;</span> 
    <span class="keyword">void</span> <a class="link" href="histogram.html#idm11539-bb"><span class="identifier">fill</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Iterable</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="weight_type.html" title="Struct template weight_type">weight_type</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">,</span> 
              <span class="keyword">const</span> <a class="link" href="sample_type.html" title="Struct template sample_type">sample_type</a><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">tuple</span><span class="special">&lt;</span> <span class="identifier">Ts</span><span class="special">...</span> <span class="special">&gt;&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Iterable<span class="special">,</span> <span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">typename</span> U<span class="special">&gt;</span> 
    <span class="keyword">void</span> <a class="link" href="histogram.html#idm11554-bb"><span class="identifier">fill</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="sample_type.html" title="Struct template sample_type">sample_type</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="weight_type.html" title="Struct template weight_type">weight_type</a><span class="special">&lt;</span> <span class="identifier">U</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">,</span> 
              <span class="keyword">const</span> <span class="identifier">Iterable</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Iterable<span class="special">,</span> <span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">typename</span> U<span class="special">&gt;</span> 
    <span class="keyword">void</span> <a class="link" href="histogram.html#idm11568-bb"><span class="identifier">fill</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="weight_type.html" title="Struct template weight_type">weight_type</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="sample_type.html" title="Struct template sample_type">sample_type</a><span class="special">&lt;</span> <span class="identifier">U</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">,</span> 
              <span class="keyword">const</span> <span class="identifier">Iterable</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Iterable<span class="special">,</span> <span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">typename</span> U<span class="special">&gt;</span> 
    <span class="keyword">void</span> <a class="link" href="histogram.html#idm11582-bb"><span class="identifier">fill</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Iterable</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="sample_type.html" title="Struct template sample_type">sample_type</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">,</span> 
              <span class="keyword">const</span> <a class="link" href="weight_type.html" title="Struct template weight_type">weight_type</a><span class="special">&lt;</span> <span class="identifier">U</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...</span> Is<span class="special">&gt;</span> <span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a class="link" href="histogram.html#idm11596-bb"><span class="identifier">at</span></a><span class="special">(</span><span class="identifier">axis</span><span class="special">::</span><span class="identifier">index_type</span><span class="special">,</span> <span class="identifier">Is</span><span class="special">...</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...</span> Is<span class="special">&gt;</span> <span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a class="link" href="histogram.html#idm11615-bb"><span class="identifier">at</span></a><span class="special">(</span><span class="identifier">axis</span><span class="special">::</span><span class="identifier">index_type</span><span class="special">,</span> <span class="identifier">Is</span><span class="special">...</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a class="link" href="histogram.html#idm11625-bb"><span class="identifier">at</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="histogram.html#boost.histogram.histogram.multi_index_type">multi_index_type</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a class="link" href="histogram.html#idm11631-bb"><span class="identifier">at</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="histogram.html#boost.histogram.histogram.multi_index_type">multi_index_type</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a class="link" href="histogram.html#idm11637-bb"><span class="keyword">operator</span><span class="special">[</span><span class="special">]</span></a><span class="special">(</span><span class="identifier">axis</span><span class="special">::</span><span class="identifier">index_type</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a class="link" href="histogram.html#idm11642-bb"><span class="keyword">operator</span><span class="special">[</span><span class="special">]</span></a><span class="special">(</span><span class="identifier">axis</span><span class="special">::</span><span class="identifier">index_type</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a class="link" href="histogram.html#idm11647-bb"><span class="keyword">operator</span><span class="special">[</span><span class="special">]</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="histogram.html#boost.histogram.histogram.multi_index_type">multi_index_type</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a class="link" href="histogram.html#idm11653-bb"><span class="keyword">operator</span><span class="special">[</span><span class="special">]</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="histogram.html#boost.histogram.histogram.multi_index_type">multi_index_type</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> A<span class="special">,</span> <span class="keyword">typename</span> S<span class="special">&gt;</span> 
    <span class="keyword">bool</span> <a class="link" href="histogram.html#idm11659-bb"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="histogram.html" title="Class template histogram">histogram</a><span class="special">&lt;</span> <span class="identifier">A</span><span class="special">,</span> <span class="identifier">S</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> A<span class="special">,</span> <span class="keyword">typename</span> S<span class="special">&gt;</span> 
    <span class="keyword">bool</span> <a class="link" href="histogram.html#idm11668-bb"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="histogram.html" title="Class template histogram">histogram</a><span class="special">&lt;</span> <span class="identifier">A</span><span class="special">,</span> <span class="identifier">S</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> A<span class="special">,</span> <span class="keyword">typename</span> S<span class="special">&gt;</span> 
    <a class="link" href="histogram.html" title="Class template histogram">histogram</a> <span class="special">&amp;</span> <a class="link" href="histogram.html#idm11677-bb"><span class="keyword">operator</span><span class="special">+=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="histogram.html" title="Class template histogram">histogram</a><span class="special">&lt;</span> <span class="identifier">A</span><span class="special">,</span> <span class="identifier">S</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> S<span class="special">&gt;</span> 
    <a class="link" href="histogram.html" title="Class template histogram">histogram</a> <span class="special">&amp;</span> <a class="link" href="histogram.html#idm11690-bb"><span class="keyword">operator</span><span class="special">+=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="histogram.html" title="Class template histogram">histogram</a><span class="special">&lt;</span> <span class="identifier">axes_type</span><span class="special">,</span> <span class="identifier">S</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> A<span class="special">,</span> <span class="keyword">typename</span> S<span class="special">&gt;</span> 
    <a class="link" href="histogram.html" title="Class template histogram">histogram</a> <span class="special">&amp;</span> <a class="link" href="histogram.html#idm11698-bb"><span class="keyword">operator</span><span class="special">-=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="histogram.html" title="Class template histogram">histogram</a><span class="special">&lt;</span> <span class="identifier">A</span><span class="special">,</span> <span class="identifier">S</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> A<span class="special">,</span> <span class="keyword">typename</span> S<span class="special">&gt;</span> 
    <a class="link" href="histogram.html" title="Class template histogram">histogram</a> <span class="special">&amp;</span> <a class="link" href="histogram.html#idm11710-bb"><span class="keyword">operator</span> <span class="special">*=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="histogram.html" title="Class template histogram">histogram</a><span class="special">&lt;</span> <span class="identifier">A</span><span class="special">,</span> <span class="identifier">S</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> A<span class="special">,</span> <span class="keyword">typename</span> S<span class="special">&gt;</span> 
    <a class="link" href="histogram.html" title="Class template histogram">histogram</a> <span class="special">&amp;</span> <a class="link" href="histogram.html#idm11722-bb"><span class="keyword">operator</span><span class="special">/=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="histogram.html" title="Class template histogram">histogram</a><span class="special">&lt;</span> <span class="identifier">A</span><span class="special">,</span> <span class="identifier">S</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="histogram.html" title="Class template histogram">histogram</a> <span class="special">&amp;</span> <a class="link" href="histogram.html#idm11734-bb"><span class="keyword">operator</span> <span class="special">*=</span></a><span class="special">(</span><span class="keyword">const</span> <span class="keyword">double</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="histogram.html" title="Class template histogram">histogram</a> <span class="special">&amp;</span> <a class="link" href="histogram.html#idm11742-bb"><span class="keyword">operator</span><span class="special">/=</span></a><span class="special">(</span><span class="keyword">const</span> <span class="keyword">double</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">iterator</span> <a class="link" href="histogram.html#idm11750-bb"><span class="identifier">begin</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="identifier">iterator</span> <a class="link" href="histogram.html#idm11753-bb"><span class="identifier">end</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="identifier">const_iterator</span> <a class="link" href="histogram.html#idm11756-bb"><span class="identifier">begin</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="identifier">const_iterator</span> <a class="link" href="histogram.html#idm11759-bb"><span class="identifier">end</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="identifier">const_iterator</span> <a class="link" href="histogram.html#idm11762-bb"><span class="identifier">cbegin</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="identifier">const_iterator</span> <a class="link" href="histogram.html#idm11765-bb"><span class="identifier">cend</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Archive<span class="special">&gt;</span> <span class="keyword">void</span> <a class="link" href="histogram.html#idm11768-bb"><span class="identifier">serialize</span></a><span class="special">(</span><span class="identifier">Archive</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">unsigned</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm12669"></a><h2>Description</h2>
<p>Histogram uses the call operator to insert data, like the <a href="https://www.boost.org/doc/libs/develop/doc/html/accumulators.html" target="_top">Boost.Accumulators</a>.</p>
<p>Use factory functions (see <a href="../../histogram/reference.html#header.boost.histogram.make_histogram_hpp" target="_top">make_histogram.hpp</a> and<a href="../../histogram/reference.html#header.boost.histogram.make_profile_hpp" target="_top">make_profile.hpp</a>) to conveniently create histograms rather than calling the ctors directly.</p>
<p>Use the <a href="indexed.html" target="_top">indexed</a> range generator to iterate over filled histograms, which is convenient and faster than hand-written loops for multi-dimensional histograms.</p>
<p>
</p>
<div class="refsect2">
<a name="idm12679"></a><h3>Template Parameters</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> Axes</pre>
<p>std::tuple of axis types OR std::vector of an axis type or <code class="computeroutput"><a class="link" href="axis/variant.html" title="Class template variant">axis::variant</a></code></p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> Storage</pre>
<p>class that implements the storage interface </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="idm12696"></a><h3>
<a name="boost.histogram.histogramconstruct-copy-destruct"></a><code class="computeroutput">histogram</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><a name="idm11776-bb"></a><span class="identifier">histogram</span><span class="special">(</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> A<span class="special">,</span> <span class="keyword">typename</span> S<span class="special">&gt;</span> <span class="keyword">explicit</span> <a name="idm11777-bb"></a><span class="identifier">histogram</span><span class="special">(</span><a class="link" href="histogram.html" title="Class template histogram">histogram</a><span class="special">&lt;</span> <span class="identifier">A</span><span class="special">,</span> <span class="identifier">S</span> <span class="special">&gt;</span> <span class="special">&amp;&amp;</span> rhs<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> A<span class="special">,</span> <span class="keyword">typename</span> S<span class="special">&gt;</span> 
  <span class="keyword">explicit</span> <a name="idm11784-bb"></a><span class="identifier">histogram</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="histogram.html" title="Class template histogram">histogram</a><span class="special">&lt;</span> <span class="identifier">A</span><span class="special">,</span> <span class="identifier">S</span> <span class="special">&gt;</span> <span class="special">&amp;</span> rhs<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> A<span class="special">&gt;</span> <a name="idm11809-bb"></a><span class="identifier">histogram</span><span class="special">(</span><span class="identifier">A</span> <span class="special">&amp;&amp;</span> a<span class="special">,</span> <span class="identifier">Storage</span> s<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">explicit</span> <a name="idm11816-bb"></a><span class="identifier">histogram</span><span class="special">(</span><span class="identifier">Axes</span> axes<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...</span> As<span class="special">&gt;</span> <span class="keyword">explicit</span> <a name="idm11819-bb"></a><span class="identifier">histogram</span><span class="special">(</span><span class="identifier">As</span> <span class="special">&amp;&amp;</span><span class="special">...</span> as<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> A<span class="special">,</span> <span class="keyword">typename</span> S<span class="special">&gt;</span> 
  <a class="link" href="histogram.html" title="Class template histogram">histogram</a> <span class="special">&amp;</span> <a name="idm11791-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><a class="link" href="histogram.html" title="Class template histogram">histogram</a><span class="special">&lt;</span> <span class="identifier">A</span><span class="special">,</span> <span class="identifier">S</span> <span class="special">&gt;</span> <span class="special">&amp;&amp;</span> rhs<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> A<span class="special">,</span> <span class="keyword">typename</span> S<span class="special">&gt;</span> 
  <a class="link" href="histogram.html" title="Class template histogram">histogram</a> <span class="special">&amp;</span> <a name="idm11800-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="histogram.html" title="Class template histogram">histogram</a><span class="special">&lt;</span> <span class="identifier">A</span><span class="special">,</span> <span class="identifier">S</span> <span class="special">&gt;</span> <span class="special">&amp;</span> rhs<span class="special">)</span><span class="special">;</span></pre></li>
</ol></div>
</div>
<div class="refsect2">
<a name="idm12848"></a><h3>
<a name="idm11382-bb"></a><code class="computeroutput">histogram</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">constexpr</span> <span class="keyword">unsigned</span> <a name="idm11383-bb"></a><span class="identifier">rank</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Number of axes (dimensions). </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idm11386-bb"></a><span class="identifier">size</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Total number of bins (including underflow/overflow). </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idm11389-bb"></a><span class="identifier">reset</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Reset all bins to default initialized values. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">unsigned</span> N <span class="special">=</span> <span class="number">0</span><span class="special">&gt;</span> 
  <span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a name="idm11392-bb"></a><span class="identifier">axis</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">integral_constant</span><span class="special">&lt;</span> <span class="keyword">unsigned</span><span class="special">,</span> <span class="identifier">N</span> <span class="special">&gt;</span> <span class="special">=</span> <span class="special">{</span><span class="special">}</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Get N-th axis using a compile-time number. <p>This version is more efficient than the one accepting a run-time number. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a name="idm11404-bb"></a><span class="identifier">axis</span><span class="special">(</span><span class="keyword">unsigned</span> i<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Get N-th axis with run-time number. <p>Prefer the version that accepts a compile-time number, if you can use it. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Unary<span class="special">&gt;</span> <span class="keyword">auto</span> <a name="idm11411-bb"></a><span class="identifier">for_each_axis</span><span class="special">(</span><span class="identifier">Unary</span> <span class="special">&amp;&amp;</span> unary<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Apply unary functor/function to each axis. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T0<span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> Ts<span class="special">&gt;</span> 
  <span class="identifier">iterator</span> <a name="idm11418-bb"></a><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T0</span> <span class="special">&amp;</span> arg0<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Ts</span> <span class="special">&amp;</span><span class="special">...</span> args<span class="special">)</span><span class="special">;</span></pre>Fill histogram with values, an optional weight, and/or a sample. <p>Returns iterator to located cell.</p>
<p>Arguments are passed in order to the axis objects. Passing an argument type that is not convertible to the value type accepted by the axis or passing the wrong number of arguments causes a throw of <code class="computeroutput">std::invalid_argument</code>.</p>
<p><span class="bold"><strong>Optional weight</strong></span></p>
<p>An optional weight can be passed as the first or last argument with the <a href="weight.html" target="_top">weight</a> helper function. Compilation fails if the storage elements do not support weights.</p>
<p><span class="bold"><strong>Samples</strong></span></p>
<p>If the storage elements accept samples, pass them with the sample helper function in addition to the axis arguments, which can be the first or last argument. The <a href="sample.html" target="_top">sample</a> helper function can pass one or more arguments to the storage element. If samples and weights are used together, they can be passed in any order at the beginning or end of the argument list.</p>
<p><span class="bold"><strong>Axis with multiple arguments</strong></span></p>
<p>If the histogram contains an axis which accepts a <code class="computeroutput">std::tuple</code> of arguments, the arguments for that axis need to be passed as a<code class="computeroutput">std::tuple</code>, for example,<code class="computeroutput">std::make_tuple(1.2, 2.3)</code>. If the histogram contains only this axis and no other, the arguments can be passed directly.</p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...</span> Ts<span class="special">&gt;</span> <span class="identifier">iterator</span> <a name="idm11447-bb"></a><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">tuple</span><span class="special">&lt;</span> <span class="identifier">Ts</span><span class="special">...</span> <span class="special">&gt;</span> <span class="special">&amp;</span> args<span class="special">)</span><span class="special">;</span></pre>Fill histogram with values, an optional weight, and/or a sample from a <code class="computeroutput">std::tuple</code>.</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Iterable<span class="special">&gt;</span> <span class="keyword">void</span> <a name="idm11456-bb"></a><span class="identifier">fill</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Iterable</span> <span class="special">&amp;</span> args<span class="special">)</span><span class="special">;</span></pre>Fill histogram with several values at once. <p>The argument must be an iterable with a size that matches the rank of the histogram. The element of an iterable may be 1) a value or 2) an iterable with contiguous storage over values or 3) a variant of 1) and 2). Sub-iterables must have the same length.</p>
<p>Values are passed to the corresponding histogram axis in order. If a single value is passed together with an iterable of values, the single value is treated like an iterable with matching length of copies of this value.</p>
<p>If the histogram has only one axis, an iterable of values may be passed directly.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">args</code></span></p></td>
<td><p>iterable as explained in the long description. </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Iterable<span class="special">,</span> <span class="keyword">typename</span> T<span class="special">&gt;</span> 
  <span class="keyword">void</span> <a name="idm11470-bb"></a><span class="identifier">fill</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Iterable</span> <span class="special">&amp;</span> args<span class="special">,</span> <span class="keyword">const</span> <a class="link" href="weight_type.html" title="Struct template weight_type">weight_type</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&amp;</span> weights<span class="special">)</span><span class="special">;</span></pre>Fill histogram with several values and weights at once. <p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">args</code></span></p></td>
<td><p>iterable of values. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">weights</code></span></p></td>
<td><p>single weight or an iterable of weights. </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Iterable<span class="special">,</span> <span class="keyword">typename</span> T<span class="special">&gt;</span> 
  <span class="keyword">void</span> <a name="idm11487-bb"></a><span class="identifier">fill</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="weight_type.html" title="Struct template weight_type">weight_type</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&amp;</span> weights<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Iterable</span> <span class="special">&amp;</span> args<span class="special">)</span><span class="special">;</span></pre>Fill histogram with several values and weights at once. <p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">args</code></span></p></td>
<td><p>iterable of values. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">weights</code></span></p></td>
<td><p>single weight or an iterable of weights. </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Iterable<span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> Ts<span class="special">&gt;</span> 
  <span class="keyword">void</span> <a name="idm11504-bb"></a><span class="identifier">fill</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Iterable</span> <span class="special">&amp;</span> args<span class="special">,</span> 
            <span class="keyword">const</span> <a class="link" href="sample_type.html" title="Struct template sample_type">sample_type</a><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">tuple</span><span class="special">&lt;</span> <span class="identifier">Ts</span><span class="special">...</span> <span class="special">&gt;&gt;</span> <span class="special">&amp;</span> samples<span class="special">)</span><span class="special">;</span></pre>Fill histogram with several values and samples at once. <p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">args</code></span></p></td>
<td><p>iterable of values. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">samples</code></span></p></td>
<td><p>single sample or an iterable of samples. </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Iterable<span class="special">,</span> <span class="keyword">typename</span> T<span class="special">&gt;</span> 
  <span class="keyword">void</span> <a name="idm11522-bb"></a><span class="identifier">fill</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="sample_type.html" title="Struct template sample_type">sample_type</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&amp;</span> samples<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Iterable</span> <span class="special">&amp;</span> args<span class="special">)</span><span class="special">;</span></pre>Fill histogram with several values and samples at once. <p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">args</code></span></p></td>
<td><p>iterable of values. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">samples</code></span></p></td>
<td><p>single sample or an iterable of samples. </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Iterable<span class="special">,</span> <span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> Ts<span class="special">&gt;</span> 
  <span class="keyword">void</span> <a name="idm11539-bb"></a><span class="identifier">fill</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Iterable</span> <span class="special">&amp;</span> args<span class="special">,</span> <span class="keyword">const</span> <a class="link" href="weight_type.html" title="Struct template weight_type">weight_type</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&amp;</span> weights<span class="special">,</span> 
            <span class="keyword">const</span> <a class="link" href="sample_type.html" title="Struct template sample_type">sample_type</a><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">tuple</span><span class="special">&lt;</span> <span class="identifier">Ts</span><span class="special">...</span> <span class="special">&gt;&gt;</span> <span class="special">&amp;</span> samples<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Iterable<span class="special">,</span> <span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">typename</span> U<span class="special">&gt;</span> 
  <span class="keyword">void</span> <a name="idm11554-bb"></a><span class="identifier">fill</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="sample_type.html" title="Struct template sample_type">sample_type</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&amp;</span> samples<span class="special">,</span> 
            <span class="keyword">const</span> <a class="link" href="weight_type.html" title="Struct template weight_type">weight_type</a><span class="special">&lt;</span> <span class="identifier">U</span> <span class="special">&gt;</span> <span class="special">&amp;</span> weights<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Iterable</span> <span class="special">&amp;</span> args<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Iterable<span class="special">,</span> <span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">typename</span> U<span class="special">&gt;</span> 
  <span class="keyword">void</span> <a name="idm11568-bb"></a><span class="identifier">fill</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="weight_type.html" title="Struct template weight_type">weight_type</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&amp;</span> weights<span class="special">,</span> 
            <span class="keyword">const</span> <a class="link" href="sample_type.html" title="Struct template sample_type">sample_type</a><span class="special">&lt;</span> <span class="identifier">U</span> <span class="special">&gt;</span> <span class="special">&amp;</span> samples<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Iterable</span> <span class="special">&amp;</span> args<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Iterable<span class="special">,</span> <span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">typename</span> U<span class="special">&gt;</span> 
  <span class="keyword">void</span> <a name="idm11582-bb"></a><span class="identifier">fill</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Iterable</span> <span class="special">&amp;</span> args<span class="special">,</span> <span class="keyword">const</span> <a class="link" href="sample_type.html" title="Struct template sample_type">sample_type</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&amp;</span> samples<span class="special">,</span> 
            <span class="keyword">const</span> <a class="link" href="weight_type.html" title="Struct template weight_type">weight_type</a><span class="special">&lt;</span> <span class="identifier">U</span> <span class="special">&gt;</span> <span class="special">&amp;</span> weights<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...</span> Is<span class="special">&gt;</span> <span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a name="idm11596-bb"></a><span class="identifier">at</span><span class="special">(</span><span class="identifier">axis</span><span class="special">::</span><span class="identifier">index_type</span> i<span class="special">,</span> <span class="identifier">Is</span><span class="special">...</span> is<span class="special">)</span><span class="special">;</span></pre>Access cell value at integral indices. <p>You can pass indices as individual arguments, as a std::tuple of integers, or as an interable range of integers. Passing the wrong number of arguments causes a throw of std::invalid_argument. Passing an index which is out of bounds causes a throw of std::out_of_range.</p>
<p>

</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">i</code></span></p></td>
<td><p>index of first axis. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">is</code></span></p></td>
<td><p>indices of second, third, ... axes. </p></td>
</tr>
</tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>reference to cell value. </p></td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...</span> Is<span class="special">&gt;</span> <span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a name="idm11615-bb"></a><span class="identifier">at</span><span class="special">(</span><span class="identifier">axis</span><span class="special">::</span><span class="identifier">index_type</span> i<span class="special">,</span> <span class="identifier">Is</span><span class="special">...</span> is<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Access cell value at integral indices (read-only). </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a name="idm11625-bb"></a><span class="identifier">at</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="histogram.html#boost.histogram.histogram.multi_index_type">multi_index_type</a> <span class="special">&amp;</span> is<span class="special">)</span><span class="special">;</span></pre>Access cell value at integral indices stored in iterable. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a name="idm11631-bb"></a><span class="identifier">at</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="histogram.html#boost.histogram.histogram.multi_index_type">multi_index_type</a> <span class="special">&amp;</span> is<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Access cell value at integral indices stored in iterable (read-only). </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a name="idm11637-bb"></a><span class="keyword">operator</span><span class="special">[</span><span class="special">]</span><span class="special">(</span><span class="identifier">axis</span><span class="special">::</span><span class="identifier">index_type</span> i<span class="special">)</span><span class="special">;</span></pre>Access value at index (for rank = 1). </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a name="idm11642-bb"></a><span class="keyword">operator</span><span class="special">[</span><span class="special">]</span><span class="special">(</span><span class="identifier">axis</span><span class="special">::</span><span class="identifier">index_type</span> i<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Access value at index (for rank = 1, read-only). </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a name="idm11647-bb"></a><span class="keyword">operator</span><span class="special">[</span><span class="special">]</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="histogram.html#boost.histogram.histogram.multi_index_type">multi_index_type</a> <span class="special">&amp;</span> is<span class="special">)</span><span class="special">;</span></pre>Access value at index tuple. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a name="idm11653-bb"></a><span class="keyword">operator</span><span class="special">[</span><span class="special">]</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="histogram.html#boost.histogram.histogram.multi_index_type">multi_index_type</a> <span class="special">&amp;</span> is<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Access value at index tuple (read-only). </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> A<span class="special">,</span> <span class="keyword">typename</span> S<span class="special">&gt;</span> 
  <span class="keyword">bool</span> <a name="idm11659-bb"></a><span class="keyword">operator</span><span class="special">==</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="histogram.html" title="Class template histogram">histogram</a><span class="special">&lt;</span> <span class="identifier">A</span><span class="special">,</span> <span class="identifier">S</span> <span class="special">&gt;</span> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Equality operator, tests equality for all axes and the storage. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> A<span class="special">,</span> <span class="keyword">typename</span> S<span class="special">&gt;</span> 
  <span class="keyword">bool</span> <a name="idm11668-bb"></a><span class="keyword">operator</span><span class="special">!=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="histogram.html" title="Class template histogram">histogram</a><span class="special">&lt;</span> <span class="identifier">A</span><span class="special">,</span> <span class="identifier">S</span> <span class="special">&gt;</span> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Negation of the equality operator. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> A<span class="special">,</span> <span class="keyword">typename</span> S<span class="special">&gt;</span> 
  <a class="link" href="histogram.html" title="Class template histogram">histogram</a> <span class="special">&amp;</span> <a name="idm11677-bb"></a><span class="keyword">operator</span><span class="special">+=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="histogram.html" title="Class template histogram">histogram</a><span class="special">&lt;</span> <span class="identifier">A</span><span class="special">,</span> <span class="identifier">S</span> <span class="special">&gt;</span> <span class="special">&amp;</span> rhs<span class="special">)</span><span class="special">;</span></pre>Add values of another histogram. <p>This operator is only available if the value_type supports operator+=.</p>
<p>Both histograms must be compatible to be addable. The histograms are compatible, if the axes are either all identical. If the axes only differ in the states of their discrete growing axis types, then they are also compatible. The discrete growing axes are merged in this case. </p>
</li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> S<span class="special">&gt;</span> 
  <a class="link" href="histogram.html" title="Class template histogram">histogram</a> <span class="special">&amp;</span> <a name="idm11690-bb"></a><span class="keyword">operator</span><span class="special">+=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="histogram.html" title="Class template histogram">histogram</a><span class="special">&lt;</span> <span class="identifier">axes_type</span><span class="special">,</span> <span class="identifier">S</span> <span class="special">&gt;</span> <span class="special">&amp;</span> rhs<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> A<span class="special">,</span> <span class="keyword">typename</span> S<span class="special">&gt;</span> 
  <a class="link" href="histogram.html" title="Class template histogram">histogram</a> <span class="special">&amp;</span> <a name="idm11698-bb"></a><span class="keyword">operator</span><span class="special">-=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="histogram.html" title="Class template histogram">histogram</a><span class="special">&lt;</span> <span class="identifier">A</span><span class="special">,</span> <span class="identifier">S</span> <span class="special">&gt;</span> <span class="special">&amp;</span> rhs<span class="special">)</span><span class="special">;</span></pre>Subtract values of another histogram. <p>This operator is only available if the value_type supports operator-=. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> A<span class="special">,</span> <span class="keyword">typename</span> S<span class="special">&gt;</span> 
  <a class="link" href="histogram.html" title="Class template histogram">histogram</a> <span class="special">&amp;</span> <a name="idm11710-bb"></a><span class="keyword">operator</span> <span class="special">*=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="histogram.html" title="Class template histogram">histogram</a><span class="special">&lt;</span> <span class="identifier">A</span><span class="special">,</span> <span class="identifier">S</span> <span class="special">&gt;</span> <span class="special">&amp;</span> rhs<span class="special">)</span><span class="special">;</span></pre>Multiply by values of another histogram. <p>This operator is only available if the value_type supports operator*=. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> A<span class="special">,</span> <span class="keyword">typename</span> S<span class="special">&gt;</span> 
  <a class="link" href="histogram.html" title="Class template histogram">histogram</a> <span class="special">&amp;</span> <a name="idm11722-bb"></a><span class="keyword">operator</span><span class="special">/=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="histogram.html" title="Class template histogram">histogram</a><span class="special">&lt;</span> <span class="identifier">A</span><span class="special">,</span> <span class="identifier">S</span> <span class="special">&gt;</span> <span class="special">&amp;</span> rhs<span class="special">)</span><span class="special">;</span></pre>Divide by values of another histogram. <p>This operator is only available if the value_type supports operator/=. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="histogram.html" title="Class template histogram">histogram</a> <span class="special">&amp;</span> <a name="idm11734-bb"></a><span class="keyword">operator</span> <span class="special">*=</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">double</span> x<span class="special">)</span><span class="special">;</span></pre>Multiply all values with a scalar. <p>This operator is only available if the value_type supports operator*=. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="histogram.html" title="Class template histogram">histogram</a> <span class="special">&amp;</span> <a name="idm11742-bb"></a><span class="keyword">operator</span><span class="special">/=</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">double</span> x<span class="special">)</span><span class="special">;</span></pre>Divide all values by a scalar. <p>This operator is only available if operator*= is available. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">iterator</span> <a name="idm11750-bb"></a><span class="identifier">begin</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return value iterator to the beginning of the histogram. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">iterator</span> <a name="idm11753-bb"></a><span class="identifier">end</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return value iterator to the end in the histogram. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_iterator</span> <a name="idm11756-bb"></a><span class="identifier">begin</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return value iterator to the beginning of the histogram (read-only). </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_iterator</span> <a name="idm11759-bb"></a><span class="identifier">end</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return value iterator to the end in the histogram (read-only). </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_iterator</span> <a name="idm11762-bb"></a><span class="identifier">cbegin</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return value iterator to the beginning of the histogram (read-only). </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_iterator</span> <a name="idm11765-bb"></a><span class="identifier">cend</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return value iterator to the end in the histogram (read-only). </li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Archive<span class="special">&gt;</span> <span class="keyword">void</span> <a name="idm11768-bb"></a><span class="identifier">serialize</span><span class="special">(</span><span class="identifier">Archive</span> <span class="special">&amp;</span> ar<span class="special">,</span> <span class="keyword">unsigned</span><span class="special">)</span><span class="special">;</span></pre></li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
      Dembinski<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="axis/null_type.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../histogram/reference.html#header.boost.histogram.histogram_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="operator_idm11825.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
